package com.spring.controller;

import com.spring.annotation.RequestMapping;
import com.spring.domain.Account;
import com.spring.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    private AccountService accountService;
    @RequestMapping("/hello")
    public String hello(){
        return "hello world";
    }
    @RequestMapping("/account")
    public Account getAccounts(Integer id){
        return accountService.findById(id);
    }
}
